﻿
@{
    ViewBag.Title = "FYXMMXQuery";
    Layout = "~/Views/Shared/_Form.cshtml";
    var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl");
    var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode");
}

<div class="rows">
	<div class="panel panel-default">
		<table class="form">
			<tr>
				<th class="formTitle">查询类别：</th>
				<td class="formValue">
					<select id="tjfw" class="form-control">
						<option value="门诊">门诊</option>
						<option value="住院">住院</option>
					</select>
				</td>

				<th class="formTitle">开始日期：</th>
				<td class="formValue">
					<input id="ksrq" type="text" class="form-control input-wdatepicker formClearIgnore" style="width:90px"
						   onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"
						   onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"
						   value="@DateTime.Now.ToString("yyyy-MM-01")" />
				</td>
				<th class="formTitle">结束日期：</th>
				<td class="formValue">
					<input id="jsrq" type="text" class="form-control input-wdatepicker formClearIgnore" style="width:90px"
						   onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"
						   onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"
						   value="@DateTime.Now.ToString("yyyy-MM-dd")" />
				</td>
				<th class="formTitle"></th>
				<td class="formValue" style="padding-left:20px;">
					<input type="button" id="btn_search" onclick="submit();" class="btn btn-primary btn-md" value="查询" style="width:55px" />
				</td>
			</tr>
			<tr>
				<th class="formTitle">医生：</th>
				<td class="formValue">
					
					<select id="yscode" class="form-control">
						<option value="" selected>全部</option>
					</select>
				</td>

				<th class="formTitle">大类名称：</th>
				<td class="formValue">
					<select id="dlmc" class="form-control">
						<option value="" selected>全部</option>
					</select>
				</td>
				<th class="formTitle">项目：</th>
				<td class="formValue">
					<input type="text" id="sfxmmc" class="form-control" />
				</td>

			</tr>
		</table>
	</div>
</div>
<div class="ui-layout" id="layout" style="height:100%;width:100%;">
	<iframe class="ui-layout-center" style="width:100%;" id="iframerightiframerightiframerightttt" name="iframerightiframerightiframerightttt"
			scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
</div>


<script>
	 var isHospAdministrator = '@(ViewBag.IsHospAdministrator)';
    var curUserCode = '@(ViewBag.CurUserCode)';
    var OrgId = '@(ViewBag.OrgId)';
	var reportServerHOST = '@(ViewBag.ReportServerHOST)';


	//大类名称绑定下拉框
	$("#dlmc").bindSelect({
		id: "dlcode",
		text: "dlmc",
		url: "/ReportManage/Report/GetDlMc",
		dropdownAutoWidth: true
	});

	$("#yscode").bindSelect({
		id: "StaffGh",
		text: "StaffName",
		url: "/ReportManage/Report/GetdoctorByDutyCode?orgId=" + OrgId,
		dropdownAutoWidth: true
	});
	$('#sfxmmc').sfxmFloatingSelector({
		djDecimalPlaces: 4,
		searchType: "sfxm",
		leftshift: 150, //整体左偏移
		ajaxparameters: function ($thisinput) {
			return "dllb=2&mzzybz=&keyword=" + $.trim($thisinput.val());
		},
		itemdbclickhandler: function ($thistr) {
			$('#sfxmmc').val($thistr.attr('data-sfxmmc'));
			$("#sfxmmc").attr("data-sfxmmc", $thistr.find("td:eq(0)").html());
		}
	});

	function submit() {
		if ($('#ksrq').val().length == 0 || $('#jsrq').val().length == 0) {
			$.modalAlert("请选择时间范围", "error");
			return;
		}
		var url = getUrl();
		$("#iframerightiframerightiframerightttt").attr('src', url);
	}

	$("#iframerightiframerightiframerightttt").load(function () {
		$.loading(false);
	});

	$(function () {
		var h = $(window).height() - 55
		$('#layout iframe').css('height', h);

	});
	 //刷新列表
    function refReport() {
        $("#btn_search").trigger('click');
    }

    function getUrl() {
        var srcUrl2 = '@Html.Raw(reportUrl)' + "?tempCode=1226" + "&orgId=" + OrgId + "&ksrq=" + $('#ksrq').val() + "&jsrq=" + $('#jsrq').val() + "&tjfw=" + $('#tjfw').val() + "&yscode=" + $('#yscode').val() + "&dlcode=" + $('#dlmc').val() + "&keyword=" + $('#sfxmmc').val() + "&systemCode=" + '@reportSystemCode';
        return srcUrl2;
    }

</script>